home *** CD-ROM | disk | FTP | other *** search
/ The Games Machine 76 / XENIATGM66.iso / Indiana Jones / Indiana Jones.exe / RESOURCE / PREVIEW.GOB / cog_pyr_nondoor.cog < prev    next >
Text File  |  1999-11-15  |  2KB  |  120 lines

  1. # Jones 3D Cog Script
  2. #
  3. # pyr_nondoor.cog
  4. #    
  5. # Commentary on a non-opening door beneath the pyramids
  6. #
  7. # [RKD]
  8. #
  9. # (C) 1998 LucasArts Entertainment Company LLC. All Rights Reserved
  10. # ========================================================================================
  11.  
  12. symbols
  13. message    activated
  14. message    startup
  15.  
  16. # world things
  17. thing    door
  18. thing    player    local
  19.  
  20. # camera things
  21. thing    doorcamfront
  22. thing    doorcamback
  23. thing    doorcamlookfront
  24. thing    doorcamlookback
  25. thing    cam1spot    local
  26. thing    cam1look    local
  27.  
  28. # sectors
  29. sector    frontsector
  30. sector    backsector
  31.  
  32. # sounds
  33. sound    doortome=inxj100.wav                local
  34.  
  35. # variables
  36. int        locked=0    local
  37. end
  38.  
  39. # ========================================================================================
  40.  
  41. # Code Section
  42. code
  43. startup:
  44.     sleep(.01);
  45.     SetSectorAdjoins(GetThingSector(door), 0);
  46.     return;
  47.  
  48. activated:
  49. # ---> door    
  50.     player = GetLocalPlayerThing();
  51.     
  52.     if (locked) return;
  53.     
  54.     # prepare the player
  55.     if (MakeMeStop() == -1) return;
  56.     DeselectWeaponWait(player);
  57.  
  58.     StartCutscene(0);
  59.     locked = 1;    
  60.     
  61.     # setup offset camera
  62.     cam1spot = CreateThing(GetThingTemplate(doorcamfront), doorcamfront);
  63.     cam1look = CreateThing(GetThingTemplate(doorcamfront), doorcamfront);
  64.     MakeCamera2LikeCamera1(cam1spot, cam1look);
  65.     SetCameraLookInterp(2, 0);
  66.     SetCameraPosInterp(2, 0);
  67.     SetCameraFocus(2, cam1spot);
  68.     SetCameraSecondaryFocus(2, cam1look);
  69.     SetCurrentCamera(2);
  70.     ResetCameraFOV(0, 0.0);
  71.     SetCameraLookInterp(2, 1);
  72.     SetCameraPosInterp(2, 1);
  73.     SetCameraInterpSpeed(2, 0.7);
  74.     Sleep(0.01);
  75.  
  76.     if (GetThingSector(player) == frontsector)
  77.     {
  78.         SetCameraFocus(2, doorcamfront);
  79.         SetCameraSecondaryFocus(2, doorcamlookfront);
  80.     }
  81.     else
  82.     {
  83.         SetCameraFocus(2, doorcamback);
  84.         SetCameraSecondaryFocus(2, doorcamlookback);
  85.     }
  86.  
  87.     # indy gesture and sayline
  88.     PlayMode(player, 60, 1);
  89.     PlayVoice(player, doortome, 1, 1);
  90.     Sleep(.5);
  91.  
  92.     # restore camera and get rid of objects
  93.     SetCameraLookInterp(2, 0);
  94.     SetCameraPosInterp(2, 0);
  95.     
  96.     if (GetThingSector(player) == frontsector)
  97.     {
  98.         SetCameraPosition(1, GetThingPos(doorcamfront));
  99.     }
  100.     else
  101.     {
  102.         SetCameraPosition(1, GetThingPos(doorcamback));
  103.     }
  104.  
  105.     SetCurrentCamera(1);
  106.     ResetCameraFOV(0, 0.0);
  107.     DestroyThing(cam1spot);
  108.     DestroyThing(cam1look);
  109.     
  110.     # restore player to normal
  111.     ClearActorFlags(player, 0x200000);
  112.     EndCutscene();
  113.  
  114.     locked = 0;
  115.     return;
  116.  
  117. end
  118.  
  119.  
  120.